package com.ys.controller.api.finance;

import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ys.entity.finance.TbPointRunningItem;
import com.ys.service.finance.TbPointRunningItemService;
import com.ys.service.sys.CommonApiService;
import com.ys.vo.LayuiTableVoJA;
import com.ys.vo.R;

@Controller
@RequestMapping("/api/inter/tbPointRunningItem")
public class ApiInterTbPointRunningItemController {
	
	public static Long MENU_ID = 108L;
	
//	private static final Logger logger = Logger.getLogger(ApiAdminLoginController.class);
	
	@Autowired
	private CommonApiService<TbPointRunningItem> commonApiService;
	@Autowired
	private TbPointRunningItemService tbPointRunningItemService;

	@RequiresPermissions("tbPointRunningItem:view")
	@RequestMapping("/search")
    @ResponseBody
	public LayuiTableVoJA search(@ModelAttribute TbPointRunningItem cond){
		
		return commonApiService.searchLay(cond);
	}
	
	/*
	 * 删除
	 */
	@RequiresPermissions("tbPointRunningItem:delete")
	@PostMapping("/delete")
	@ResponseBody
	public R delete(Long id) {
		return tbPointRunningItemService.deleteFalse(id);
	}
	
	/**
	 * 新增
	 */
	@RequiresPermissions("tbPointRunningItem:add")
	@PostMapping("/add")
    @ResponseBody
	public R add(@RequestParam Map<String, Object> params){
		return tbPointRunningItemService.add(params);
	}
	
	/**
	 * 编辑
	 */
	@RequiresPermissions("tbPointRunningItem:edit")
	@PostMapping("/edit")
    @ResponseBody
	public R edit(@RequestParam Map<String, Object> params){
		return tbPointRunningItemService.edit(params);
	}
	
}
